import 'package:flutter/material.dart';
import 'package:flutter_color_plugin/flutter_color_plugin.dart';
import 'package:flutter_qiniu_upload/flutter_qiniu_upload.dart';
import 'package:yw_bapp/widgets/filed_tag_widget.dart';
import 'package:yw_bapp/widgets/m_btn.dart';
import 'package:yw_bapp/widgets/safe_area_bar_widget.dart';
import 'package:yw_bapp/widgets/yz_img_picker.dart';

// 门店信息设置
class StoreInfoSet extends StatefulWidget {
  @override
  _StoreInfoSetState createState() => _StoreInfoSetState();
}

class _StoreInfoSetState extends State<StoreInfoSet> {
  // 下一步按钮的颜色
  bool isActive = false;
  // 按钮点击色
  Color btnActiveColor = ColorUtil.color('#FFC49226');
  // 按钮默认色
  Color btnDefaultColor = ColorUtil.color('#FFCCCCCC');
  // 文字点击色
  Color textActiveColor = Colors.white;
  // 文字默认色
  Color textDefaultColor = Colors.white;
  TextStyle actionStyle =
      TextStyle(color: Colors.black, fontSize: 15, fontWeight: FontWeight.bold);
      @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: XAppBar(
          statusBarColor: ColorUtil.color('#FFC49226'),
          bgColor: ColorUtil.color('#FFC49226'),
          title: "门店信息设置",
          iconColor: Colors.white,
        ),
        body: Container(
          padding: EdgeInsets.only(top: 10),
          color: ColorUtil.color("#FFEEEEEE"),
          child: ListView(
            children: [
              // 人均消费价格
              Container(
                height: 50,
                padding: EdgeInsets.only(right: 15),
                color: Colors.white,
                child: Row(
                  children: [
                    FiledTagWidget(
                      tagName: '人均消费价格',
                      fieldText: '',
                      hintText: '请输入',
                      typeNum: 2,
                      changeCallback: (String value) {},
                      isEnabled: true,
                    ),
                    Text(
                      "元",
                      style: TextStyle(
                          color: Colors.black,
                          fontSize: 15,
                          fontWeight: FontWeight.bold),
                    )
                  ],
                ),
              ),
              // 店铺LOGO
              Container(
                margin: EdgeInsets.only(top: 10),
                child: UcarImagePicker(
                  title: '店铺LOGO设置',
                  maxCount: 1,
                  onChanged: (value) {
                    print('店铺LOGO$value');
                    if(value != null) {
                    }
                  },
                ),
              ),
              // 店铺首图
              Container(
                margin: EdgeInsets.only(top: 10),
                child: UcarImagePicker(
                  title: '店铺首图设置',
                  maxCount: 1,
                  onChanged: (value) {
                    print('店铺首图设置$value');
                  },
                ),
              ),
              // 店铺轮播图
              Container(
                margin: EdgeInsets.only(top: 10),
                child: UcarImagePicker(
                  title: '店铺轮播图片设置',
                  maxCount: 5,
                  onChanged: (value) {
                    print('店铺轮播图片设置$value');
                  },
                ),
              ),
              // 按钮保存
              Container(
                margin: EdgeInsets.fromLTRB(25, 76, 25, 20),
                child: MBtn(
                  btnWidth: 325,
                  btnHeight: 47,
                  borderRadius: 5,
                  title: '提交',
                  hasBg: true,
                  textColor: isActive ? textActiveColor : textDefaultColor,
                  bgColor: isActive ? btnActiveColor : btnDefaultColor,
                  borderColor: isActive ? btnActiveColor : btnDefaultColor,
                  function: () {},
                ),
              )
            ],
          ),
        ));
  }
}
